//
//  HomeButton.m
//  DMGME
//
//  Created by ihope99 on 15/8/31.
//  Copyright (c) 2015年 GYP. All rights reserved.
//

#import "HomeButton.h"

@implementation HomeButton

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        CGFloat splaceY;
        CGFloat splaceH;

        if (IsiPhone6||IsiPhone6Plus) {
            splaceY = 40;
            splaceH = 65;
        }else if (IsiPhone5){
            splaceY = 35;
            splaceH = 50;
        }else{
            splaceY = 20;
            splaceH = 40;
        }

        _headImageView = [[UIImageView alloc] init];
//        _headImageView.center = CGPointMake(self.frame.size.width/2, (splaceY + splaceH)/2);
//        _headImageView.frame = CGRectMake(45, splaceY, self.frame.size.width - 90, splaceH);
//        _headImageView.backgroundColor = [UIColor whiteColor];
//        _headImageView.image = [UIImage imageNamed:@"Book@2x"];
        
        _lable = [[UILabel alloc] init];
        _lable.frame = CGRectMake(10, self.frame.size.height - 45, self.frame.size.width-20, 20) ;
        _lable.textAlignment = NSTextAlignmentCenter;
        _lable.textColor = [UIColor whiteColor];
        
        [self addSubview:_headImageView];
        [self addSubview:_lable];
        
    }
    return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
